<?php

namespace App\Services\TransferGoldBean;

use App\Models\User;

class SupportGoldBean
{
	/**
	 * @var User
	 */
	protected $child;

	public function __construct(User $child)
	{
		$this->child = $child;
	}

	protected function transfer()
	{
		$beans = big_decimal(cs('storm')->gold_support_beans);

		if ($beans->isLessThanOrEqualTo(0)) return;

		account_beans($this->child)->plusSupportedGoldBeans($beans);
	}

	public function support()
	{
		$this->transfer();
	}
}
